package com.sh.caryr.erp.entity.trade;

import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.sh.caryr.erp.entity.BaseEntity;
import com.sh.caryr.erp.util.DateUtils;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("erp_as_order")
public class AsOrder extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer type;       //10:Refund; 20:Exchange

    private String typeDesc;    //10:Refund; 20:Exchange

    private Integer processResult;      //10:Refund; 20:Exchange

    private String processResultDesc;   //10:Refund; 20:Exchange

    private Integer status;

    private String statusDesc;

    private int returnType = 0; //0.Not return; 1.Return usable; 2.Return broken

    /**
     * External platform. Eg.: JingDong; TianMao;
     */
    private String extPlatform;

    /**
     * External as order Id
     */
    private String extId;

    private String extOrderId;

    private String extProductSpecId;

    private String extProductSpecName;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long orderId;

    private Long productSpecId;

    private Float productSpecQuantity;

    private Float amount;

    //*** Receiver info
    private String receiver;

    private String nickName;

    private String phoneNum;

    private String address;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtils.DATE_FORMAT)
    private Date applyTime;

    private String systemRemark;
}
